
package com.studiofortress.sf.structure.collisions;

import com.studiofortress.sf.structure.Action;
import com.studiofortress.sf.structure.Actor;
import java.util.Collection;
import java.util.LinkedList;

/**
 * This is a Collision class for when a World should have no collisions at all,
 * the equivalent of removing all collisions content from a World. You may wish
 * to do this for Worlds where no collision detection will ever be used.
 * 
 * All methods do nothing, all their parameters are ignored and all return
 * values return the default value that represents no collision.
 * 
 * @author Joseph Lenton
 * @version 11/03/2008
 */
public final class NoCollisions<A extends Actor> implements CollisionHandler<A>
{
    /**
     * Trivial Constructor.
     */
    public NoCollisions() { }

    /**
     * @param actor Ignored.
     */
    @Override
    public final void add(A actor)
    {
        // do nothing
    }

    /**
     * @param actor Ignored.
     */
    @Override
    public final void remove(A actor)
    {
        // do nothing
    }

    /**
     * @param actor Ignored.
     */
    @Override
    public final void update(A actor)
    {
        // do nothing
    }

    /**
     * @param actor Ignored.
     * @param collisionClasses Ignored.
     * @return An empty list, always.
     */
    @Override
    public final Collection<A> getIntersectingActors(A actor, Class<? extends A> ... collisionClasses)
    {
        return new LinkedList<A>();
    }

    /**
     * @param actor Ignored.
     * @param collisionClasses Ignored.
     * @return Null, always.
     */
    @Override
    public final A getIntersectingActor(A actor, Class<? extends A> ... collisionClasses)
    {
        return null;
    }

    /**
     * @param actor Ignored.
     * @param action Ignored.
     * @param collisionClasses Ignored.
     * @return false, always.
     */
    @Override
    public boolean applyToIntersectingActor(A actor, Action<A> action, Class<? extends A>... collisionClasses)
    {
        return false;
    }

    /**
     * @param actor Ignored.
     * @param action Ignored.
     * @param collisionClasses Ignored.
     * @return false, always.
     */
    @Override
    public boolean applyToIntersectingActors(A actor, Action<A> action, Class<? extends A>... collisionClasses)
    {
        return false;
    }
}
